package com.example.controller;

import com.example.entity.SchInformation;
import com.example.service.RecommendationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/recommendations")
public class RecommendationController {
    @Autowired
    private RecommendationService recommendationService;

    @GetMapping
    public ResponseEntity<List<SchInformation>> recommendSchools(@RequestParam String schClass, @RequestParam String schoolProject) {
        List<SchInformation> recommendations = recommendationService.recommendSchools(schClass, schoolProject);
        return ResponseEntity.ok(recommendations);
    }
}

